Repository navigation
context: direction and max_depth bound the walk - #2034
Open
Ayingxizhao wants to merge 2 commits into
Open
Ayingxizhao wants to merge 2 commits into
Ayingxizhao wants to merge 2 commits into
Conversation
start_symbol and token_budget map to the existing --from and --page-budget; direction and max_depth are checked but not yet used; expand_context is refused as not implemented. With the new inputs left out, answers are unchanged.
The file walk follows only the edges a direction asks for, out to --depth; the flow takes --depth as its cap and is not told for callers only. Which way a direction follows an edge is defined once, in ax_walk.py, for the CLI and the MCP server. With the inputs left out, both walks keep today's bounds.
Ayingxizhao
marked this pull request as ready for review
November 24, 2026 04:45
Ayingxizhao
requested review from
JaredHLZhang,
Whua689,
suyashpaliwal26 and
swapnilpaliwal-sd
as code owners
November 24, 2026 04:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #2033.
What changed
context'sdirectionandmax_depthnow bound its two walks, and the answer says where the file walk stopped.Left out, both walks keep today's bounds, so default answers are unchanged.
ax_walk.py(new): which way a walk follows a call edge, as one definition for the CLI and the MCP server.DIRECTIONS = {'callees': {FORWARD}, 'callers': {BACKWARD}, 'both': {FORWARD, BACKWARD}}. A direction is a set ofways, so a new one is one more entry rather than a new branch in each verb.
neighbourhood()(the file walk) takesdirectionand builds only the edges it follows; its fixedcap=3becomesNEIGHBOURHOOD_DEPTH, overridden by--depth. Given areport, it recordsdepth_reachedandstop_reason(
complete, ordepth_limitwhen the cap left something unreached).flow()takes--depthas itsdepth_cap(defaultFLOW_DEPTH, as before). The flow follows calls forward, soit is not told when the walk goes only to callers.
--json:omittedlists the files the budget cut, andstop_reasonis thenbudget_limit.mcp/server.pychecksdirectionagainstax_walk.DIRECTIONSinstead of its own list.SKILL.md,AGENTS.md: whatdirectionandmax_depthmean.Why the goldens moved, or why they did not
No golden moved. Nothing under
test/*/expectedchanged: this touches the query side only, not the rules or theparser.
Evidence
New case
tests/cases/python/context-walk-direction-and-depth, a chaincheckout → charge_card → send_receipt → write_log, one function per file:send_receiptdirection callersdirection calleesdirection callers,depth 1and for the flow from
checkout:depth 1stops atcharge_card;direction callerstells no flow.Against #2033's code, 5 of the case's 6 checks fail (the control passes), so the case tests this change.
Checklist
tests/run.py --lang python: 485 of 489 pass; the 4 failures (text-interpolated-phrase,text-when-the-graph-has-no-answer) fail the same way ondevtests/front_door.py21 of 21;tests/mcp.py,tests/mcp_docs.pypass;tests/surfaces.pyfails only onREADME.md CLI section: names the flag --fresh, as ondev